package com.bwie.qsuntils;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: qs
 * @Date: 2024/12/25 08:44
 * @Description:
 **/
public class ChouUtil {
//    实现简单随机抽奖工具封装
    public static int getRandom(int max){
        return (int)(Math.random()*max);
    }
    public static int getRandom(int min,int max){
        return (int)(Math.random()*(max-min+1)+min);
    }
    public static int getRandom(int[] arr){
        int index = (int)(Math.random()*arr.length);
        return arr[index];
    }
    public static int getRandom(int[] arr,int min,int max){
        int index = (int)(Math.random()*(max-min+1)+min);
        return arr[index];
    }
    public static int getRandom(int[] arr,int min,int max,int[] exclude){
        int index = (int)(Math.random()*(max-min+1)+min);
        return arr[index];
    }

//    实现库存抽奖算法工具封装
    public static int getRandom(int[] arr,int[] exclude){
        int index = (int)(Math.random()*arr.length);
        return arr[index];
    }
//    实现用户群体抽奖工具封装

    public static int getRandom(int[] arr,int[] exclude,int[] userGroup){
        int index = (int)(Math.random()+arr.length*exclude.length*userGroup.length);
        return index;
    }

    public static void main(String[] args) {

        int[] ess= {1,2,3,4,5,6,7,8,9,10};
        int[] eaa={55,33,22,11,66,77,88,99,100};
        int[] edd={99,88,77,66,55,44,33,22,11};
        int random = getRandom(ess, eaa, edd);
        System.out.println("您抽到的号码为:"+random);

        ArrayList<String> stringArrayList = new ArrayList<>();
        stringArrayList.add("张三");
        stringArrayList.add("李四");
        stringArrayList.add("王五");

    }



    public static String tolist(){


        return null;
    }

}
